package
{
	import flash.events.Event;
	import message.httpController.httpModelBase;
	import flashx.textLayout.elements.ParagraphElement;
	import flashx.textLayout.elements.SpanElement;
	
//	import json.JSON;
	
//	import message.Messenger;
	
	import mx.core.FlexGlobals;
	
	import spark.components.TextArea;

	public class lobbyChatSend1 extends httpModelBase
	{
		private var time:Number = 0;
		var myXML:XML = new XML(); 
		public function lobbyChatSend1()
		{
			super();
		}
		
		override public function send(val:Object=null) : void
		{
			var curTime:Date = new Date();
			var delta:Number = curTime.getTime() - time;	
			
//				httpservice.url = "http://10.10.4.151:9090/TankRankWeb/f2_game/get_rank.php";
				httpservice.url = "http://localhost:8080/FightLandlordServer/1";
				httpservice.request = {"server":"S1","type":"101","limit":"50","flag":"42191e096b5e73cab93df99ed2146c87"};
				httpservice.send();
		
		}
		
		override public function result(event:Event) : void
		{
//			time = (new Date()).getTime();
//			Messenger.Instance.send(null, Messenger.receiveLobby);
			//trace(httpservice.lastResult.toString());		
//				myXML = XML(httpservice.lastResult); 
//				trace("数据装载完成."); 
//				trace (myXML); 
//				trace(myXML.entity[0].name);
//				trace(myXML.result);
			
		}
		
		override public function fault(event:Event) : void
		{
			addErrMsg("发送的消息超时失败。");
		}
		
		protected function addErrMsg(str:String) : void
		{
//			var ta:TextArea = TextArea(FlexGlobals.topLevelApplication.functionpanel.lobbychatbox);
//
//			//
//			var pp:ParagraphElement = new ParagraphElement();
//			var span:SpanElement;
//			span = new SpanElement();
//			span.text = "系统提示:"+str;
//			span.color = 0xffcc33;
//			span.fontSize = 12;
//			pp.addChild(span);
//			ta.textFlow.addChild(pp);		
//
//			ta.appendText("");
		}
	}
}